/*
 * @Description:
 * @Author: py
 * @Date: 2024-07-30
 */
import type { PlusColumn } from 'plus-pro-components'

import { useDicts } from './use-dicts'

const { getDictOptions } = useDicts()

const aSaleTypeOptions = getDictOptions('oAfterSaleType')
export function useForm() {
    const schema: PlusColumn[] = [
        {
            colProps: {
                span: 6,
            },
            label: '订单编号',
            prop: 'orderCode',
            valueType: 'copy',
        },
        {
            colProps: {
                span: 6,
            },
            label: '售后单号',
            prop: 'afterSaleCode',
            valueType: 'copy',
        },
        {
            colProps: {
                span: 6,
            },
            label: '售后类型',
            options: aSaleTypeOptions,
            prop: 'afterSaleType',
            valueType: 'select',
        },
    ] as const

    const state = {
        afterSaleCode: '',
        afterSaleType: '',
        orderCode: '',
    }
    const form = ref({
        ...state,
    })
    return { form, schema, state }
}
